// 1.引入 vue 和 vue-router
import Vue from 'vue'
import VueRouter from 'vue-router'

// 2.将 vue-router 安装为vue 的插件
Vue.use(VueRouter)
// 创建路由实例对象
const router = new VueRouter({
  routes:[
    {path:'/home',component: () => import('@/components/Home.vue')},
    {path:'/movie',component: () => import('@/components/Movie.vue')},
    {
      path:'/about',
      component: () => import('@/components/About.vue'),
      children:[
        {path:'tab1',component:() => import('@/components/tabs/Tab1.vue')},
        {path:'/about/tab2',component:() => import('@/components/tabs/Tab2.vue')}
      ]
    }
  ]

})
// 4.导出路由实例对象
export default router